package com.zbb.order.model.po;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 发起订单表
 * </p>
 *
 * @author itcast
 */
@Data
@TableName("zbb_order_initiate")
public class OrderInitiate implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private String id;

    /**
     * 订单校园id
     */
    private Integer schoolId;

    /**
     * 订单校区id
     */
    private Integer campusId;

    /**
     * 用户Id
     */
    private String userId;

    /**
     * 用户名称
     */
    private String userName;

    /**
     * 订单标题
     */
    private String orderTitle;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 查看人数
     */
    private Integer hotness;


    //信誉分
    private float creditScore;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime creationTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modificationTime;

    public OrderInitiate(String id, Integer schoolId, Integer campusId, String userId, String userName, String orderTitle, String remarks, Integer status, Integer hotness, LocalDateTime startTime, LocalDateTime endTime) {
        LocalDateTime time = LocalDateTime.now();
        this.id = id;
        this.schoolId = schoolId;
        this.campusId = campusId;
        this.userId = userId;
        this.userName = userName;
        this.orderTitle = orderTitle;
        this.remarks = remarks;
        this.status = status;
        this.hotness = hotness;
        this.startTime = startTime;
        this.endTime = endTime;
        this.creationTime = time;
        this.modificationTime = time;
    }

    public OrderInitiate() {
    }
}
